﻿<?php
$bdd = new PDO('mysql:host=localhost;dbname=brin_de_soleil', 'root', '');

$reponse = $bdd->prepare('SELECT * FROM sejour NATURAL JOIN secteur_physique,sejour_avant, sejour_precision, sejour_referent_adulte WHERE code = :code
OR date_creation = :datecreation OR pays  = :pays OR periode = :periode OR intitule = :intitule OR secteur_physique = :secteurphy
OR secteur_sejour = :secteursejour OR autonomie = :autonomie OR date_depart = :datedepart OR lieu_depart = :lieudepart OR date_retour = :dateretour
OR lieu_retour = :lieuretour OR duree = :duree OR duree_effective = :dureeeffect OR nb_places = :nbplace OR nb_responsables = :nbresp
OR nb_resp_service = :nbrespserv OR tranche_age1 = :tranche1 OR tranche_age2 = :tranche2 OR tranche_age3 = :tranche3 OR public = :public
OR tarif_catalogue = :tarifcata OR tarif_ce = :tarifce OR tarif_acompte = :tarifacompte OR date_acompte = :dateacompte OR supp_transport = :supptransp
OR num_compte_comptable = :numcompte OR aller = :aller OR pendant = :pendant OR retour = :retour OR num_vehicule_aller = :vehiculealler
OR num_vehicule_retour = :vehiculeretour OR hebergement = :hebergement OR fixe = :fixe OR itinerant = :itinerant OR complete = :pension 
OR libre = :gestionlibre OR nom_heberg = :nomheberg OR responsable_heberg = :respheberg OR adresse_heberg = :adresseheberg
OR ville = :ville OR date_preparation = :reunionprep OR date_veille = :reunionveille OR factgroupe = :factgroupe OR afacturer = :afacturer
OR facturele = :facturele OR numfacture = :numfacture OR montant = :montant OR relance = :relance');
$reponse->execute(array(
	'code' => $_POST['code'],
	'datecreation' => $_POST['datecreation'],
	'pays' => $_POST['pays'],
	'periode' => $_POST['periode'],
	'intitule' => $_POST['intitule'],
	'secteurphy' => $_POST['secteurphy'],
	'secteursejour' => $_POST['secteursejour'],
	'autonomie' => $_POST['autonomie'],
	'datedepart' => $_POST['datedepart'],
	'lieudepart' => $_POST['lieudepart'],
	'dateretour' => $_POST['dateretour'],
	'lieuretour' => $_POST['lieuretour'],
	'duree' => $_POST['duree'],
	'dureeeffect' => $_POST['dureeeffect'],
	'nbplace' => $_POST['nbplace'],
	'nbresp' => $_POST['nbresp'],
	'nbrespserv' => $_POST['nbrespserv'],
	'tranche1' => $_POST['tranche1'],
	'tranche2' => $_POST['tranche2'],
	'tranche3' => $_POST['tranche3'],
	'public' => $_POST['public'],
	'tarifcata' => $_POST['tarifcata'],
	'tarifce' => $_POST['tarifce'],
	'tarifacompte' => $_POST['tarifacompte'],
	'dateacompte' => $_POST['dateacompte'],
	'supptransp' => $_POST['supptransp'],
	'numcompte' => $_POST['numcompte'],
	'aller' => $_POST['aller'],
	'pendant' => $_POST['pendant'],
	'retour' => $_POST['retour'],
	'vehiculealler' => $_POST['vehiculealler'],
	'vehiculeretour' => $_POST['vehiculeretour'],
	'hebergement' => $_POST['hebergement'],
	'fixe' => isset($_POST['fixe'])?1:0,
	'itinerant' => isset($_POST['itinerant'])?1:0,
	'pension' => isset($_POST['pension'])?1:0,
	'gestionlibre' => isset($_POST['gestionlibre'])?1:0,
	'nomheberg' => $_POST['nomheberg'],
	'respheberg' => $_POST['respheberg'],
	'adresseheberg' => $_POST['adresseheberg'],
	'ville' => $_POST['ville'],
	'reunionprep' => $_POST['reunionprep'],
	'reunionveille' => $_POST['reunionveille'],
	'factgroupe' => isset($_POST['factgroupe'])?1:0,
	'afacturer' => isset($_POST['afacturer'])?1:0,
	'facturele' => $_POST['facturele'],
	'numfacture' => $_POST['numfacture'],
	'montant' => $_POST['montant'],
	'relance' => isset($_POST['relance'])?1:0,
	));
	
		echo"<table border= 1>";
		echo"<tr align= center>";
				echo"<td><b>Code séjour</b></td>";
				echo"<td><b>Date création</b></td>";
				echo"<td><b>Pays</b></td>";
				echo"<td><b>Période</b></td>";
				echo"<td><b>Intitulé</b></td>";
				echo"<td><b>Secteur phy</b></td>";
				echo"<td><b>Secteur séjour</b></td>";
				echo"<td><b>Autonomie</b></td>";
				echo"<td><b>Date départ</b></td>";
				echo"<td><b>Lieu départ</b></td>";
				echo"<td><b>Date retour</b></td>";
				echo"<td><b>Lieu retour</b></td>";
				echo"<td><b>Durée séjour</b></td>";
				echo"<td><b>Durée effective</b></td>";
				echo"<td><b>Nb places</b></td>";
				echo"<td><b>Nb responsable</b></td>";
				echo"<td><b>Nb personnes service</b></td>";
				echo"<td><b></b>1ere tranche</td>";
				echo"<td><b>2eme tranche</b></td>";
				echo"<td><b>3eme tranche</b></td>";
				echo"<td><b>Public</b></td>";
				echo"<td><b>Tarif catalogue</b></td>";
				echo"<td><b>Tarif CE</b></td>";
				echo"<td><b>Tarif 1er acompte</b></td>";
				echo"<td><b>Date 1er acompte</b></td>";
				echo"<td><b>Supp transport</b></td>";
				echo"<td><b>N° compte comptable</b></td>";
				echo"<td><b>Aller</b></td>";
				echo"<td><b>Pendant</b></td>";
				echo"<td><b>Retour</b></td>";
				echo"<td><b>Num véhicule aller</b></td>";
				echo"<td><b>Num véhicule retour</b></td>";
				echo"<td><b>Hébergement</b></td>";
				echo"<td><b>Fixe</b></td>";
				echo"<td><b>Itinérant</b></td>";
				echo"<td><b>Pension</b></td>";
				echo"<td><b>Gestion libre</b></td>";
				echo"<td><b>Comentaire</b></td>";
				echo"<td><b>Nom hébergement</b></td>";
				echo"<td><b>Responsable hébergement</b></td>";
				echo"<td><b>Tel responsable</b></td>";
				echo"<td><b>Adresse hébergement</b></td>";
				echo"<td><b>Code postal</b></td>";
				echo"<td><b>Ville</b></td>";
				echo"<td><b>Email</b></td>";
				echo"<td><b>Contact</b></td>";
				echo"<td><b>Tel contact</b></td>";
				echo"<td><b>Résumé séjour</b></td>";
				echo"<td><b>Formalité</b></td>";
				echo"<td><b>Résumé locaux</b></td>";
				echo"<td><b>Date réunion préparation</b></td>";
				echo"<td><b>Date réunion veille</b></td>";
				echo"<td><b>Restauration aller</b></td>";
				echo"<td><b>Hébergement aller</b></td>";
				echo"<td><b>Restauration retour</b></td>";
				echo"<td><b>Hébergement retour</b></td>";
				
				
			echo"</tr>";
		while ($donnees = $reponse->fetch())
		{
			echo"<tr>";
				echo "<td><input style='text-align:center' type=text value='".$donnees['code']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['date_creation']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['pays']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['periode']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['intitule']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['secteur_physique']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['secteur_sejour']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['autonomie']."'/></td>";				
				echo "<td><input style='text-align:center' type=text value='".$donnees['date_depart']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['lieu_depart']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['date_retour']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['lieu_retour']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['duree']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['duree_effective']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['nb_places']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['nb_responsables']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['nb_pers_service']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['public']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tranche_age1']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tranche_age2']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tranche_age3']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tarif_catalogue']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tarif_ce']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tarif_acompte']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['date_acompte']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['supp_transport']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['num_compte_comptable']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['commentaire']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['nom_heberg']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['responsable_heberg']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tel_resp']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['adresse_heberg']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['codepostal']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['ville']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['mail']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['contact']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['tel_contact']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['resume']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['formalite']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['resume_locaux']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['date_preparation']."'/></td>";		
				echo "<td><input style='text-align:center' type=text value='".$donnees['date_veille']."'/></td>";		
			echo"</tr>";
		}
		echo"</table>";
?>